@datepicker-radius: 3px;
@datepicker-shadow: 0 4px 16px 1px rgba(0, 0, 0, 0.24), 0 0 1px 0 rgba(0, 0, 0, 0.12);
@datepicker-border: 1px solid @grayLighter;
@datepicker-panel-width: 246px;

@prefixClass: Calendar;

// Datepicker
.@{prefixClass} {
  margin: 10px 0;
  &-picker-input {
    outline: none;
    cursor: pointer;
  }

  position: relative;
  outline: none;
  font-family: Arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
  width: 246px;
  border: @datepicker-border;
  list-style: none;
  font-size: 12px;
  text-align: left;
  background-color: #fff;
  border-radius: 3px;
  box-shadow: @datepicker-shadow;
  background-clip: padding-box;
  line-height: 1.5;

  &-date-panel,
  &-panel {
    position: relative;
    outline: none;
  }

  &-week-number {
    width: 286px;

    &-cell {
      text-align: center;
    }
  }

  &-title {
    display: inline-block;
    font-size: 16px;

    .@{prefixClass}-beginEnd {
      font-weight: 600;
    }

    .@{prefixClass}-content {
      color: #000;
      & > span {
        display: inline-block;
        margin-left: 4px;
        cursor: pointer;
        user-select: none;
        &:hover {
          color: @themeColor3;
        }
        &.active {
          color: @themeColor3;
        }
      }
    }
  }

  &-header {
    height: 45px;
    line-height: 45px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: @datepicker-border;

    > .Icon {
      display: inline-block;
      line-height: 40px;
      width: 40px;
      height: 40px;
      text-align: center;
      font-size: 14px;

      &:hover {
        cursor: pointer;
        color: @themeColor3;
      }
    }

    .@{prefixClass}-prev-month-btn {
      position: absolute;
      top: 2px;
      left: 0;
    }

    .@{prefixClass}-next-month-btn {
      position: absolute;
      top: 2px;
      right: 0;
    }
  }

  &-body {
    padding: 9px 10px 10px;
    height: 221px;
    box-sizing: border-box;
  }

  &-table {
    border-spacing: 0;
    margin-bottom: 0;
  }

  .calendar-year-table {
    list-style-type: none;
    margin: 0;
    padding: 0;
    &:after {
      content: '';
      display: block;
      width: 100%;
      height: 0;
      clear: both;
    }
    & > li {
      display: block;
      width: 25%;
      height: 50px;
      text-align: center;
      line-height: 50px;
      float: left;
      user-select: none;
      cursor: pointer;
      color: #333;
      &:hover {
        background-color: #f5f5f5;
      }
      &.active {
        color: @themeColor3;
      }
    }
  }

  .calendar-month-table {
    list-style-type: none;
    margin: 0;
    padding: 0;
    &:after {
      content: '';
      display: block;
      width: 100%;
      height: 0;
      clear: both;
    }
    & > li {
      display: block;
      width: 33.33333%;
      width: calc(100% / 3);
      height: 50px;
      text-align: center;
      line-height: 50px;
      float: left;
      user-select: none;
      cursor: pointer;
      color: #333;
      &:hover {
        background-color: #f5f5f5;
      }
      &.active {
        color: @themeColor3;
      }
    }
  }

  .calender-task-header {
    background-color: #f5f5f5;
    border-radius: 3px 0 0 3px;
    &:after {
      content: '';
      display: block;
      width: 100%;
      height: 0;
      clear: both;
    }

    .calender-task-header-col {
      width: 50%;
      padding: 13px 16px;
      box-sizing: border-box;
      float: left;
    }
  }

  &-every-week {
    margin: 4px 0;
    display: flex;
  }

  &-thead-column {
    display: flex;
  }

  &-column-header {
    line-height: 18px;
    padding: 6px 0;
    width: 33px;
    text-align: center;
    .@{prefixClass}-column-header-inner {
      display: block;
      font-weight: normal;
      color: @gray;
      font-size: 13px;
    }
  }

  &-cell {
    flex: 1;
  }

  &-date {
    z-index: 99;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    line-height: 24px;
    text-align: center;
    &:hover {
      background-color: #e0e0e0;
    }
  }

  &-disabled-cell {
    color: @grayLighter;
    border-radius: 0;
    width: auto;
  }

  &-disabled-cell &-date:hover {
    cursor: not-allowed;
    background: #fff;
  }

  &-selected-date &-date {
    color: #fff !important;
    background-color: @themeColor3;
  }

  &-today &-date {
    color: @themeColor3;
  }

  &-last-month-cell &-date,
  &-next-month-btn-day &-date {
    display: none;
  }

  &-footer {
    border-top: 1px solid #ccc;
    text-align: center;
    position: relative;
    background-color: @grayLightest;
    &-basic {
      display: flex;
      a {
        flex: 1;
      }
    }
  }
  &-footer-back {
    padding: 8px 0;
    & > .Icon {
      display: inline-block;
      width: 30px;
      height: 30px;
      font-size: 24px;
      text-align: center;
      line-height: 30px;
      color: #bdbdbd;
      user-select: none;
      cursor: pointer;
      &:hover {
        color: @themeColor3;
      }
    }
  }

  &-timepicker {
    display: inline-block;
    margin-right: 30px;
    &-title {
      line-height: 45px;
      height: 45px;
      display: inline-block;
      margin-right: 6px;
    }
    .Dropdown {
      width: 70px;
      z-index: 100;
    }
  }

  &-time-picker-btn {
    margin-left: 10px;
  }

  &-today-btn,
  &-morrow-btn,
  &-clear-btn {
    color: @gray;
    font-size: 14px;
    height: 45px;
    line-height: 45px;
    &:hover {
      color: @themeColor3;
      text-decoration: none;
    }
  }

  &-today-btn {
    padding-left: 10px;
  }

  &-ok-btn {
    padding: 5px 10px;
    display: inline-block;
    box-sizing: border-box;
    text-shadow: none;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    user-select: none;
    background: @themeColor3;
    vertical-align: middle;
    &:hover {
      text-decoration: none;
      background: @themeColor2;
    }
  }
  &-clear-btn {
    height: 28px;
    line-height: 28px;
    display: inline-block;
    margin-right: 18px;
    vertical-align: middle;
  }
}
